@require "./variable.styl"
@require "./mixin.styl"

html {
  -webkit-font-feature-settings: 'kern' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height 100%;
}

body {
  height 100%;
  color: $color-font
}

::-webkit-scrollbar {
  width: 7px;
  height: 7px
}

::-webkit-scrollbar-track {
  background-color: rgba(0, 0, 0, .1)
}

::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, .3)
}

::-webkit-scrollbar-thumb:hover {
  background-color: rgba(0, 0, 0, .5)
}

::-webkit-scrollbar-thumb:active {
  background-color: rgba(0, 0, 0, .7)
}

.thin-scroll::-webkit-scrollbar-track {
  background-color: #E5E5E5;
  border-left: 2px solid transparent
}

.thin-scroll::-webkit-scrollbar-thumb {
  background-color: #A6A6A6;
  border-left: 2px solid transparent
}

.thin-scroll::-webkit-scrollbar {
  width: 7px
}

/* FLEXBOX LAYOUT */
.flex-center,
.flex-column,
.flex-middle,
.flex-middle-center {
  display: flex
}

.flex-middle-center,
.flex-center {
  justify-content: center
}

.flex-middle-center,
.flex-middle {
  align-items: center
}

.flex-column {
  flex-direction: column
}

.flex-grow {
  flex-grow: 1
}

/* TEXT HELPERS */
.text-muted {
  color: inherit;
  opacity: .555
}

.text-no-dec {
  text-decoration: none !important
}

.text-underline {
  text-decoration: underline
}

.text-line-through {
  text-decoration: line-through
}

.font-xxxxl {
  font-size: $fontsize-large-xxxx !important
}

.font-xxxl {
  font-size: $fontsize-large-xxx !important
}

.font-xxl {
  font-size: $fontsize-large-xx !important
}

.font-xl {
  font-size: $fontsize-large-x !important
}

.font-lg {
  font-size: $fontsize-large !important
}

.font-md {
  font-size: $fontsize-medium !important
}

.font-sm {
  font-size: $fontsize-small !important
}

.font-xs {
  font-size: $fontsize-small-xs !important;
  line-height: 1.2
}

.font-xxs {
  font-size: $fontsize-small-xxs !important;
  line-height: 1.2
}

.font-xxxs {
  font-size: $fontsize-small-xxs !important;
  line-height: 1.2
}

.font-thin {
  font-weight: 300
}

.font-normal, b {
  font-weight: 400
}

/* BORDER RADIUS HELPERS */
.rad-0 {
  border-radius: 0 !important
}

.rad-3 {
  border-radius: 3px !important
}

.rad-15 {
  border-radius: 15px !important
}

.rad-30 {
  border-radius: 30px !important
}

/* NO BORDER */
.b-no {
  border: none transparent !important
}

.bt-no {
  border-top: none !important
}

.br-no {
  border-right: none !important
}

.bl-no {
  border-left: none !important
}

.bb-0 {
  border-bottom: none !important
}

/* display */
.absolute {
  position: absolute !important
}

.relative {
  position: relative !important
}

.static {
  position: static !important
}

.fixed {
  position: fixed !important
}

.wrap {
  white-space: pre-wrap
}

.nowrap {
  white-space: nowrap
}

.hidden {
  display: none !important
}

.hide {
  display: none;
  transition: all 1s ease
}

.b-no {
  bottom: 0
}

.r-0 {
  right: 0
}

.l-0 {
  left: 0
}

.t-0 {
  top: 0
}

.absolute-middle,
.absolute-middle-center {
  transform: translateY(-50%);
  position: absolute;
  top: 50%
}

.absolute-middle-center {
  transform: translateX(-50%);
  left: 50%
}

/* display */
.b-primary {
  border: 1px solid $color-primary !important
}

.b-success {
  border: 1px solid $color-success !important
}

.b-info {
  border: 1px solid $color-info !important
}

.b-warning {
  border: 1px solid $color-warning !important
}

.b-danger {
  border: 1px solid $color-danger !important
}

.b-white {
  border: 1px solid $color-white !important
}

.b-grey {
  border: 1px solid $color-light-grey !important
}

.operations {
  padding 15px;
}

.card, .panel {
  box-shadow: 0 2px 3px rgba(0, 0, 0, .05);
  border: 1px solid rgba(0, 0, 0, .05);
}

.card-900 {
  width 900px;
}

.line {
  text-align center;
}

.pagination {
  margin-top: 15px;
  padding: 10px 20px;
  display: flex;
  justify-content: flex-end;
}

.el-table__header, table {
  border-top: 1px solid #dee2e6;
  th {
    background-color: #f5fbff;
  }
}

table {
  th {
    font-size $fontsize-small-xs;
    font-weight 300;
    color $color-font-x;
  }
}

/* ---------------------------- */
/*  Treetable
/* ---------------------------- */
.treetable {
  border-radius: 6px 6px 3px 3px;
  caption {
    font-size: .9em;
    font-weight: 700;
    margin-bottom: .2em
  }
  th {
    padding: 1em
  }
  .indenter {
    user-select: none;
    text-align: center
  }
  .indenter {
    vertical-align: middle;
  }
  .indenter > a {
    font-family: element-icons !important;
    display: inline-block;
    color: currentColor;
    font-size: 1.0625rem;
    text-align: center;
    line-height: 1.4rem;
    width: 1.5rem;
    margin: 0;
  }
  .collapsed .indenter a:before {
    content: "\E602";
  }
  .expanded .indenter a:before {
    content: "\E63C";
  }
  .accept {
    background-color: #a3bce4;
    color: #fff
  }
}

/* ---------------------------- */
/*  Treelist
/* ---------------------------- */
.treelist {
  list-style: none;
  padding: 0;
  ul {
    padding: .625rem 0 .625rem 3.125rem;
    position: relative;
    list-style: none;
    margin: 0;
    display: none
  }
  .open > ul {
    display: block
  }
  ul:before {
    background: #e2e2e2;
    position: absolute;
    height: calc(100% - 2rem);
    content: '';
    width: 1px;
    left: 1.5rem;
    top: -.5rem
  }
  > li:before,
  > li:after {
    display: none
  }
  li {
    position: relative
  }
  li:before,
  li:after {
    position: absolute;
    background: #e2e2e2;
    content: '';
    top: 1.5rem
  }
  li:before {
    height: 1px;
    width: 1.5rem;
    right: 100%
  }
  li:after {
    border-radius: 50%;
    margin-top: -.15625rem;
    left: -1.76rem;
    padding: .15625rem
  }
  .treeitem {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    margin-bottom: .5em;
    border-radius: .25rem;
    position: relative;
    padding: .625rem;
    color: #777
  }
  .treeitem:hover,
  .treeitem:focus {
    background: #f6f6f6;
    color: #333
  }
  .treeitem > i {
    margin: 0 .25rem;
    text-align: center;
    width: 1.1rem
  }
  .parent > .treeitem > .indicator {
    text-align: center;
    width: 1.5625rem;
    line-height: 1;
    cursor: pointer
  }
  .parent > .treeitem > .indicator::before {
    font-family: themify;
    content: '\E65D'
  }
  .parent.open > .treeitem > .indicator::before {
    content: '\E65F'
  }
  .parent:last-child::before {
    border-top: 1px solid #e2e2e2;
    background: #fff;
    height: 100%
  }
  .sortable-drag,
  .sortable-ghost {
    box-shadow: 0 1px 15px 0 rgba(0, 0, 0, 0.2)
  }
}

/* BOOTSTRAP OVERRIDE */
.card, .panel {
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.05)
}

.list-group-item {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  outline: 0
}

.list-group.no-border > .list-group-item {
  border-color: transparent
}

.list-group.list-group-gap > .list-group-item {
  margin-bottom: 5px;
  border-radius: 3px
}

.list-group.list-group-sm > .list-group-item {
  padding: 6px 10px
}

.item-content:after {
  background-color: #eee;
  position: absolute;
  content: '';
  height: 1px;
  bottom: 0;
  left: 30px;
  right: 0;
}

.dropdown-menu .list-unstyled {
  max-height: 200px;
  overflow-x: hidden;
  overflow-y: auto
}

.list-group.stateful > .list-group-item {
  text-align: inherit;
  color: #464a4c;
  width: 100%
}

.list-group.stateful > .list-group-item:before {
  content: '';
  width: 3px;
  position: absolute;
  bottom: 0;
  left: 0;
  top: 0
}

.list-group.stateful > .list-group-item:focus,
.list-group.stateful > .list-group-item:hover {
  background-color: #f7f7f9;
  color: #464a4c
}

.state-default, .state-primary, .state-warning, .state-danger, .state-info {
  background-color: #eceeef !important
}

.state-default:before {
  background-color: #999999
}

.state-primary:before {
  background-color: #007aff
}

.state-warning:before {
  background-color: #f0ad4e
}

.state-danger:before {
  background-color: #f05050
}

.state-info:before {
  background-color: #5bc0de
}

.layer-loading {
  background: rgba(255, 255, 255, .5);
  padding-top: 15rem;
  position: absolute;
  height: 100%;
  width: 100%;
  z-index: 1;
  bottom: 0;
  & > i {
    animation: bounce 1.4s infinite ease-in-out;
    animation-fill-mode: both;
    background-color: #A6A6A6;
    display: inline-block;
    border-radius: 100%;
    margin: 0 2px;
    height: 18px;
    width: 18px;
    &:nth-child(2) {
      animation-delay: .2s
    }
    &:nth-child(3) {
      animation-delay: .4s
    }
  }
}

.progress-overlay {
  background-color: rgba(255, 255, 255, .5);
  position: absolute;
  z-index: 2;
  bottom: 0;
  right: 0;
  left: 0;
  top: 0
}

.progress-overlay > .progress-circle {
  position: absolute;
  top: 50%;
  left: 50%;
  margin-left: -1rem;
  margin-top: -1rem
}

.progress-circle {
  background: url("../icon/progress-circle.svg") no-repeat center;
  width: 2rem;
  height: 2rem;
  background-size: 100% auto;
  margin: 0 auto
}

.aside {
  transition: opacity .5s, transform .5s cubic-bezier(.25, .8, .25, 1);
  box-shadow: 0 7px 21px rgba(0, 0, 0, 0.3);
  backface-visibility: hidden;
  background-color: #fff;
  overflow-x: hidden;
  position: fixed;
  z-index: 20;
  opacity: 0;
  top: 60px;
  &.show {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
  &.right, &.left {
    overflow-y: auto;
    bottom: 0
  }
  &.bottom, &.top {
    right: 0;
    left: 0
  }
  &.top {
    transform: translate3d(0, -100%, 0);
    bottom: auto;
    top: 0
  }
  &.bottom {
    transform: translate3d(0, 100%, 0);
    bottom: 0;
    top: auto
  }
  &.right {
    transform: translate3d(100%, 0, 0);
    left: auto;
    right: 0
  }
  &.left {
    transform: translate3d(-100%, 0, 0)
  }
}

.white-overlay {
  background-color: rgba(255, 255, 255, .65)
}

.black-overlay {
  background-color: rgba(0, 0, 0, .65)
}

body.aside-show {
  overflow-y: hidden !important
}

.bordered-columns {
  > div {
    border: 1px dashed #dedede;
    border-width: 0 1px 0 0;
  }
  .disk {
    padding: 10px;
    &:hover {
      background-color: #fffff4
    }
    &:last-child {
      border-right: none
    }
  }
}

.widget-weather {
  text-align: center;

  .actual {
    padding-top: 63px;
    padding-bottom: 63px;
    font-weight: bold;
    border-right: 1px solid #eee;
    p {
      margin-bottom: 4px;
      font-size: 1rem;
    }
    .climacon {
      font-size: 5.4375rem;
      line-height: 10px
    }
    h3 {
      font-weight: bold;
      margin-top: 5px;
    }
  }
  .days > div {
    padding: 30px 0;
    border: 1px solid #eee;
    border-width: 0 1px 0 0;
    &:last-child {
      border-right: none
    }
    .climacon {
      line-height: 10px
    }
    h3 {
      margin-top: 15px
    }
    h3:last-child {
      color: #cacdd2
    }
    p {
      font-size: 1.375rem;
      padding-bottom: 7px;
      margin-bottom: 7px;
      border-bottom: 1px solid #fafafa
    }
  }
}

.to-corner {
  position: absolute !important;
  top: 5px;
  right: 5px
}

.network {
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  margin: 1px;
  border-radius: 100%;
  border: 2px solid #fff
}

.network.bottom {
  top: auto;
  right: 0;
  bottom: 0;
  left: auto
}

.network.on {
  background-color: #56af55
}

.network.off {
  background-color: #f05050
}

.network.away {
  background-color: #fad733
}

/* error pages */
.error-shape {
  border-radius: 30px;
  position: relative;
  overflow: hidden !important;
  height: 150px;
  width: 150px;
  font-size: 4.6875rem;
  line-height: 150px;
  display: inline-block;
  &.err-404 {
    text-shadow: #e0ce66 1px 1px, #e0ce66 2px 2px, #e0ce66 3px 3px, #e0ce66 4px 4px, #e0ce66 5px 5px, #e0ce66 6px 6px, #e0ce66 7px 7px, #e0ce66 8px 8px, #e0ce66 9px 9px, #e0ce66 10px 10px
  }
  &.err-500 {
    text-shadow: #dd2158 1px 1px, #dd2158 2px 2px, #dd2158 3px 3px, #dd2158 4px 4px, #dd2158 5px 5px, #dd2158 6px 6px, #dd2158 7px 7px, #dd2158 8px 8px, #dd2158 9px 9px, #dd2158 10px 10px
  }
  span {
    position: absolute;
    top: 50%;
    left: 50%;
    display: block;
    height: 150px;
    width: 150px;
    margin: -75px 0 0 -75px;
    white-space: nowrap;
    text-align: center;
    color: #fff
  }
}

/* tables */
.sortable > i:before {
  border: 5px solid transparent;
  border-top-color: #A6A6A6;
  position: absolute;
  margin-left: .5rem;
  margin-top: -2px;
  content: '';
  top: 50%
}

.sortable.asc > i:before {
  border-top-color: transparent;
  border-bottom-color: #A6A6A6;
  margin-top: -7px
}

.table .md-check {
  vertical-align: sub
}

.table-no-border tr td {
  border: none !important
}

.table-no-th-border thead tr th {
  border: none !important
}

.table-bordered tr > td {
  border: 1px solid #ebebeb
}

.table-centered td {
  text-align: center
}

.table-vertical-middle td, .table > thead > tr > th {
  vertical-align: middle
}

.table > thead > tr > th {
  text-transform: uppercase;
  font-weight: 600;
  font-size: .8124rem;
  padding-top: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #ddd;
  color: #999
}

.table-advanced {
  thead tr th {background-color: #f5fbff;
  padding: 1em
}

tbody tr > i {
  font-size: .875rem
}

tbody tr td {
  vertical-align: middle
}

&.table-hover tr:hover td {
  background-color: #f9f9f9
}

}